package org.jeecg.glr.service;


import com.baomidou.mybatisplus.extension.service.IService;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import org.jeecg.glr.entity.GlrSensor;
import org.jeecg.glr.entity.GlrSensorData;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: 传感器
 * @Author: jeecg-boot
 * @Date:   2020-02-11
 * @Version: V1.0
 */
public interface IGlrSensorService extends IService<GlrSensor> {

    void saveEntity(GlrSensor glrSensor);

    void updateEntityById(GlrSensor glrSensor);

    void removeEntityByIds(List<String> asList);

    void removeEntityById(String id);

    GlrSensorData getGlrSensorOne(String type, HttpServletRequest request);

    /**
     * 获取LED屏在线状态
     * @return
     */
    List<String> getGlrSensorStatus();


    GlrSensorData getGlrSensorByCodeOne(String code);

    GlrSensor getGlrSensorByCode(String code,String type);

    /**
     * 解析处理设备传来的数据
     *
     * @param buf
     * @param channel
     */
    public void dealData(ByteBuf buf, Channel channel);

    public List<GlrSensor> getSenSorAll();
    public void removeOffLineGataWay(ChannelHandlerContext ctx);
    public void removeVocOffLineGataWay(ChannelHandlerContext ctx);

    public  void saveSenSorCode(Short key, Channel channel);
    public void intiSenSorAll();

    void dealVocData(ByteBuf buf, Channel channel);

    void initSensor();
}
